/*
 * @Author: your name
 * @Date: 2021-09-18 20:02:02
 * @LastEditTime: 2021-09-26 15:03:41
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \egg-example\mock.js
 */
// const Mock = require("mockjs")
// const query = require("./mysql")

// let { shop_list } = Mock.mock({
//     "shop_list|20": [{
//         peizhi: "www",
//         mtime: "08:00-12:00",
//         img: "https://pic2.zhimg.com/v2-1edf13fafa9bab2e621bb1733501a314_250x0.jpg?source=172ae18b",
//         title: "@cword(20,40)",
//         huojian: "@cword(3,4)",
//         yjia:/\d{2}/,
//         mjia:/\d{2}/,
//         xianl:/\d{2}/,
//         xianls:/\d{2}/,
//         mzhuang:"关闭",
//         zhuang:"false",
//         time:"@data(MMMM-mm-mm))"
//     }]
// })
// shop_list.forEach(item => {
//     console.log(item);
//     let sql = `insert into miaoshop 
//     (peizhi,mtime,img,title,huojian,yjia,mjia,xianl,xianls,mzhuang,zhuang,time,)
//     values 
//     ("${item.peizhi}","${item.mtime}","${item.img}","${item.title}","${item.huojian}","${item.yjia}","${item.mjia}","${item.xianl}","${item.xianls}","${item.mzhuang}","${item.zhuang}","${item.time}")`
//     query(sql)
// })

// 规格
const Mock = require("mockjs")
const query = require("./mysql")

let { shop_list } = Mock.mock({
    "shop_list|100": [{
        "name": "@cword(3,8)",
        "specification": "@cword(3,5)",
        "property": /\d{3}/,
    }]
    //name	specification	property	key

})
shop_list.forEach(item => {
    console.log(item);
    let sql = `insert into guige 
    (name,specification,property)
    values 
    ("${item.name}","${item.specification}","${item.property}")`
    query(sql)
})


// let { shop_list } = Mock.mock({
//     "shop_list|50": [{
//         peizhi: '@ctitle(3,5)',
//         mtime:'8:00-12:00',
//         title: "@cword(3,5)",
//         huojian: "活动简介",
//         yjia:'0.00',
//         mjia:'0.40',
//         xianl:'12',
//         xianls:'12',
//         mzhuang:/开启|关闭/,
//         zhuang:/true|false/,
//         time:'2021-05-06',
//         img:'https://unsplash.it/400/800/?@name',
//     }]
// })
// shop_list.forEach(item => {
//     console.log(item);
//     let sql = `insert into miaoshop (peizhi,mtime,img,title,huojian,yjia,mjia,xianl,xianls,mzhuang,zhuang,time ) values ("${item.peizhi}","${item.mtime}","${item.img}","${item.title}","${item.huojian}","${item.yjia}","${item.mjia}","${item.xianl}","${item.xianls}","${item.mzhuang}","${item.zhuang}","${item.time}") `
//     query(sql)
// })


// let { shop_list } = Mock.mock({
//     "shop_list|50": [{
//         name: '@ctitle(3,5)',
//         mtime:'8:00-12:00',
//         zhuangt:/开启|关闭/,
//         ctime:'2021.1.15',
//         img:'https://unsplash.it/400/800/?@name',
//     }]
// })
// shop_list.forEach(item => {
//     console.log(item);
//     let sql = `insert into miaopei (name,mtime,img,zhuangt,ctime) values ("${item.name}","${item.mtime}","${item.img}","${item.zhuangt}","${item.ctime}") `
//     query(sql)
// })


// name
// text
// sping
// fping
// ptext
// htext
// time
// shi


// let { shop_list } = Mock.mock({
//     "shop_list|100": [{
//         // name: '@ctitle(3,5)',
//         // mtime:'8:00-12:00',
//         // zhuangt:/开启|关闭/,
//         // ctime:'2021.1.15',
//         // img:'https://unsplash.it/400/800/?@name',
// name:"@cname",
// text:"@cword(3,7)",
// sping:/\d{1}/,
// fping:/\d{1}/,
// ptext:"@cword(3,7)",
// htext:"@cword(3,7)",
// time:"@date",
// shi:"今天"
//     }]
// })
// shop_list.forEach(item => {
//     console.log(item);
//     let sql = `insert into pinjia (name,
//         text,sping,fping,ptext,htext,time,shi)values
//     ("${item.name}","${item.text}","${item.sping}","${item.fping}","${item.ptext}","${item.htext}","${item.time}","${item.shi}") `
//     query(sql)
// })


// text:"@cname",
// sping:
// fping:
// ptext:
// htext:
// time:
// shi:

// let { shop_list } = Mock.mock({
//     "shop_list|500": [{
//         sort:/\d{2}/,
//         type:"产品分类",
//         state:/true|false/,
//         lls:/显示|不显示/,
//         img:'https://unsplash.it/400/800/?@name',
//         name: /\d{3}/
//     }]
// })
// shop_list.forEach(item => {
//     console.log(item);
//     let sql = `insert into classify (type,img,sort,state,name,lls) values
//      ("${item.type}","${item.img}","${item.sort}","${item.state}","${"每日新品"+item.name}","${item.lls}") `
//     query(sql)
// })




// let { shop_list } = Mock.mock({
//     "shop_list|500": [{
//         sort:/\d{2}/,
//         type:"产品分类",
//         state:/true|false/,
//         lls:/显示|不显示/,
//         img:'https://unsplash.it/400/800/?@name',
//         name: /\d{3}/
//     }]
// })
// shop_list.forEach(item => {
//     console.log(item);
//     let sql = `insert into classify (type,img,sort,state,name,lls) values
//      ("${item.type}","${item.img}","${item.sort}","${item.state}","${"每日新品"+item.name}","${item.lls}") `
//     query(sql)
// })



// // tuan shangid img shangjie yjia pjiachenren canren time lls huoz	llss
// let { shop_list } = Mock.mock({
//     "shop_list|500": [{
//         // sort:/\d{2}/,
//         // type:"产品分类",
//         // state:/true|false/,
//         // lls:/显示|不显示/,
//         // img:'https://unsplash.it/400/800/?@name',
//         // name: /\d{3}/
//         tuan:"",
//         shangid:"",
//         img:"",
//         shangjie:"",
//         yjia:"",
//         pjiachenren:"",
//         canren:"",
//         time:"",
//         lls:"",
//         huoz:"",
//         llss:""
//     }]
// })
// shop_list.forEach(item => {
//     console.log(item);
//     let sql = `insert into classify (tuan,shangid,img,shangjie,yjia,pjiachenren,canren,time,lls,huoz,llss) values
//      ("${item.type}","${item.img}","${item.sort}","${item.state}","${"每日新品"+item.name}","${item.lls}") `
//     query(sql)
// })
